CLASSPATH='champ/*:vivace/*:vivace/view/*:.'

all: 
	zsh -c "javac -encoding ISO8859-1 -cp ${CLASSPATH} **/*java"

run: all
	java -cp ${CLASSPATH} vivace.Start

clean:
	zsh -c "rm vivace/**/*class"
#rm vivace/*class vivace/model/*class vivace/view/*class 

#jar: all
#	@echo -n "Unzipping champ.jar..."
#	@if LANG=sv_SE unzip champ/champ.jar 1>/dev/null; then echo "[[32mOK[0m]" ;else echo "[[33mFAIL[0m]"; fi
#	@echo -n "Compiling jar archive..."
#	@if LANG=sv_SE jar cfe vivace.jar vivace/Start lib/ resources/ vivace; then echo "[[32mOK[0m]" ;else echo "[[33mFAIL[0m]"; fi
#	@echo -n "Removing temporary directories..."
#	@if rm -r lib && rm -r META-INF; then echo "[[32mOK[0m]" ;else echo "[[33mFAIL[0m]"; fi
jar: all
	zsh -c "{\
	 mkdir .makejar ;\
	 cd .makejar ;\
	 jar xvf ../champ/champ.jar ;\
	 cp -r ../vivace/ ../resources/ .;\
	 jar cvfe vivace-i2-`svn info|grep Rev| cut -f 2 -d:| tr -d " "`.jar vivace/Start vivace/ lib/ ;\
	 mv vivace*jar .. ;\
	 cd .. ;\
	 rm -rf .makejar ;\
	 }"
